<%-- 
    Document   : contactos
    Created on : 08/04/2013, 01:43:32 AM
    Author     : grakeskull
--%>

<%@page import="edu.capex.farmacus.mail.MailManager"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <%@include file="/resources/header.jsp" %>
        <script src="../js/bsa.js"></script>
    </head>
    <%@include file="/resources/header1.jsp" %>
    <body class="preview" data-spy="scroll" data-target=".subnav" data-offset="80">
        <div class="container">

            <div class="span12">
                <h3>Farmacus,S A </h3>



                <p class="span6">Teléfonos: 809.573.3885 </p>
                <p class="span7">Fax: 809.573.5671 </p>
                <p class="span6"> Direccion:Calle Principal No 5. Residencial Santa Maria La Vega, República Dominicana </p>
                <p class="span7">e-mail: farmacus@farmacus.com.do </p>

                <img src="/farmacus/imagenes/map.jpg" width="150" height="150"alt="Imagen de muestra" class="span6"/></span>

            </div>
            <section id="forms">

                <form class="form-horizontal well" method="POST" action="#">
                    <fieldset>

                        <div class="control-group">
                            <label class="control-label" for="input01">Nombre</label>
                            <div class="controls">
                                <input type="text" class="input-xlarge" name="nombre" id="input01">
                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="input01">Correo</label>
                            <div class="controls">
                                <input type="text" class="input-xlarge" name="correo" id="input01">
                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label" for="textarea">Mensaje</label>
                            <div class="controls">
                                <textarea class="input-xlarge" id="textarea" name="mensaje" rows="3"></textarea>
                            </div>
                        </div>

                        <div class="form-actions">
                            <button type="submit" class="btn btn-primary">Enviar</button>
                            <button type="reset" class="btn">Cancelar</button>
                        </div>
                    </fieldset>
                </form>

                
                <%@include file="/resources/footer1.jsp" %>
                <%
                    if (request.getParameter("nombre") != null && request.getParameter("mensaje") != null && request.getParameter("correo") != null) {
                        String[] recipients = {"farmacusproject@gmail.com"};
                        String from = "farmacusproject@gmail.com";
                        String subject = "Hemos recibido un nuevo correo.";
                        String message = "La persona: " + request.getParameter("nombre") + ". Correo: " + request.getParameter("correo") + "\n\n" + request.getParameter("mensaje");

                        new MailManager().sendSSLMessage(recipients, subject, message, from);
                %>
                <script type="text/javascript">
                    $(document).ready(function(){
                        alert("Gracias por contactarnos.");
                    });
                </script>
                <%
                    }
                %>
            </section>
        </div>
    </body>
</html>
